import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * Created by mauricio on 9/18/14.
 */
public class PrimeFactors {

    private static List list = new ArrayList();
    private static void addFactor(int factor) {
        if(!list.contains(factor)) {
            list.add(factor);
        }
    }
    public static List generate(int num) {

        int quotient = 0;
        for (int factor = 2; factor <= num ; factor++) {
            if (num%factor == 0) {
                addFactor(factor);
                quotient = num / factor;
                if(quotient != 1) {
                    return generate(quotient);
                } else break;
            }
        }
        return list;
    }

    public static void main(String[] args) {
        System.out.println(PrimeFactors.generate(191));
    }
}